<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--{{capitalize | capitalize 5}}-->
    <input type="text" v-model="capitalize | cap 5">
    {{capitalize}}
</div>
<script src="vue.js"></script>
<script>
    Vue.filter('cap', {
        read: function (val,begin,end) {
            return val.slice(0,begin).toUpperCase()
        },
        write: function (val) {
            console.log(val);
            //当我们input标签写入内容的时候 会默认调用write方法
            return val+100;
        }
    });

    var vm = new Vue({
        el:"#app",
        data:{
            capitalize:'abcdefghijq',
            count:0,
            flag:-1,
            json:{name:1},
            arr:[
                {name:'jw1',age:1},
                {name:'jw2'},
                {name:'jw3'},
                {name:'jw4',age:1},
                {name:'jw5'},
                {name:'jw6'},
                {name:'jw7',age:1},
                {name:'jw8'},
                {name:'jw9'},
                {name:'jw10'},
                {name:'jw11'},
                {name:'jw12'},
                {name:'jw13'},
            ]
        }
    })
</script>
</body>
</html>